package com.example.design_pattern.responsibility_chain;

public abstract class Player {

    private Player mSuccessor;

    protected abstract void handle(int index);

    protected void next(int index){
        if(mSuccessor != null){
            mSuccessor.handle(index);
        }else{
            System.out.println("没有下一个玩家了........");
        }
    }

    public Player getmSuccessor() {
        return mSuccessor;
    }

    public void setmSuccessor(Player mSuccessor) {
        this.mSuccessor = mSuccessor;
    }
}
